using System.Collections.Generic;
using System.Text;
using Voodoo.Sauce.Internal.CrossPromo.Models;

namespace Voodoo.Sauce.Internal.CrossPromo.Utils
{
	public static class SerializerUtils
	{
		public static string GamesInstalled()
		{
			List<AssetModel> gamesInstalled = VoodooCrossPromo.Info.GamesInstalled;
			StringBuilder stringBuilder = new StringBuilder();
			for (int i = 0; i < gamesInstalled.Count; i++)
			{
				if (i != 0)
				{
					stringBuilder.Append(",");
				}
				stringBuilder.Append(gamesInstalled[i].game.bundle_id);
			}
			return stringBuilder.ToString();
		}

		public static string VideosFromCache()
		{
			StringBuilder stringBuilder = new StringBuilder();
			int num = 0;
			string[] allFilesFromCache = CacheManager.GetAllFilesFromCache();
			foreach (string filePath in allFilesFromCache)
			{
				AssetModel asset = PlayerPrefsUtils.GetAsset(PlayerPrefsUtils.GetKey(filePath));
				if (asset != null)
				{
					if (num++ != 0)
					{
						stringBuilder.Append(",");
					}
					stringBuilder.Append(asset.id);
				}
			}
			return stringBuilder.ToString();
		}
	}
}
